-
-
Notifications
You must be signed in to change notification settings - Fork 16
Handle Arduino CLI 1.x core list
command output data format
#285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The action parses the output of the `arduino-cli core list --format json` command. There was a breaking change to the data format of that output was changed in the 1.0.0 release of Arduino CLI. The action code is updated to handle the new output, while also retaining backwards compatibility with the pre-1.x data format in order to support workflows that pin the Arduino CLI version to >1.0.0 via the action's "cli-version" input.
The action parses the JSON formatted output of the `arduino-cli core list` command. The action depends on the output having a specific data format, which includes the key names. If the Arduino CLI developers change the name of a key used by the action, it breaks the action. Some time ago, there was a comprehensive review and standardization of the Arduino CLI output key names, which resulted in many changes to the key names. A key name translation system was added to the action code in order to handle that breaking change. Although the action's current code only relies on a couple of keys from a single command, it is planned to use other parts of the output over time (e.g., getting the compilation data now available from the `arduino-cli compile --format json` output instead of parsing the text output as was necessary at the time the action was created). There was an impression of finality to the new key names. For these reasons, the decision was made to implement a comprehensive translation system rather than limiting the scope to only the keys used by the action at the time. Since that time, various key name changes have occurred at various times. Since none of the changed keys were used by the action, this did not cause breakage, but it did render the comprehensive key name translation system outdated. A key used by the action has been renamed once again in the Arduino CLI 1.0.0 release, which requires the translation system to be redesigned and updated. The fact that the comprehensive system has not been kept updated indicates that it is not feasible to maintain such a system. So, rather than investing the significant amount of effort that would be required to review all the changes made to the Arduino CLI output key names and update the comprehensive translation system accordingly, the translation system is trimmed back to only cover the keys actually used by the action. It will be expanded on demand.
The comment was somehow moved to a different line than the code it refers to.
The action parses the output of the `arduino-cli core list --format json` command. The name of one of the keys in that output data used by the action was changed in the 1.0.0 release of Arduino CLI, breaking the action when used with that version of Arduino CLI (which is the default behavior). The action code base already has a key name translation system, which was implemented to handle breakage caused by a previous round of key name changes. However, that system was designed under the assumption that the key names would be stable following the comprehensive redesign that caused the previous changes. It was not designed to handle multiple changes to the name of a given key as has now happened. For this reason, the translation system has been redesigned to support any number of key name changes that might occur.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #285 +/- ##
=======================================
Coverage 99.81% 99.81%
=======================================
Files 2 2
Lines 1608 1623 +15
=======================================
+ Hits 1605 1620 +15
Misses 3 3 ☔ View full report in Codecov by Sentry. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
topic: code
Related to content of the project itself
type: imperfection
Perceived defect in any part of project
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The action parses the output of the
arduino-cli core list --format json
command.There were multiple breaking changes to the data format of that output in the 1.0.0 release of Arduino CLI. These caused runs of workflows using the action to fail if the workflow used a platform dependency source other than Boards Manager
Change to overall data structure
https://arduino.github.io/arduino-cli/1.0/UPGRADING/#cli-changed-json-output-for-some-lib-core-config-board-and-sketch-commands
This is fixed by https://github.com/arduino/compile-sketches/tree/40f6d20f1d0c2fcab12ef7ab9d30439ed1dc79f0
installed
key renamed toinstalled_version
https://arduino.github.io/arduino-cli/1.0/UPGRADING/#cli-core-list-and-core-search-changed-json-output
This is fixed by https://github.com/arduino/compile-sketches/tree/26705b342943dcb94c56a93270d73c1be2e267ab
Fixes #284